<template>

    <table class="table table-bordered">
        <tr>
    
            <th>
    `           姓名
                
            </th>
            <th>
              <input type="text" v-model="aa.Name">
                
            </th>
        </tr>
    
    
          <tr>
    
            <th>
               账号
                
            </th>
            <th>
               <input type="text" v-model="aa.Member_Name">
                
            </th>
        </tr>
            
        <tr>
    
    <th>
       密码
        
    </th>
    <th>
       <input type="password" v-model="aa.Member_Pwd">
        
    </th>
    </tr>
    
    <tr>
    
    <th>
       手机号
        
    </th>
    <th>
       <input type="text" v-model="aa.Member_Phone">
        
    </th>
    </tr>
    
    <tr>
    
    <th>
       性别
        
    </th>
    <th>
       <input type="radio"  value="true" v-model="aa.Member_Sex">男
       <input type="radio"  value="false" v-model="aa.Member_Sex">女
        
    </th>
    </tr>
    
    <tr>
    
    <th>
       身份证
        
    </th>
    <th>
       <input type="text" v-model="aa.Member_IdCard">
        
    </th>
    </tr>
    
    <tr>
    
    <th>
       生日
        
    </th>
    <th>
       <input type="date" v-model="aa.Member_Birthday">
        
    </th>
    </tr>
    
    <tr>
    
    <th>
       价钱
        
    </th>
    <th>
       <input type="text" v-model="aa.Member_Money">
        
    </th>
    </tr>
    
    <tr>
    
    <th>
       状态
        
    </th>
    <th>
       <input type="radio" value="true" v-model="aa.Member_State">正常
       
        <input type="radio" value="false" v-model="aa.Member_State">冻结
        
    </th>
    </tr>
    
    
    <tr>
    
    <th>
       积分
        
    </th>
    <th>
       <input type="text" v-model="aa.Member_Integration">
        
    </th>
    </tr>
    
    <tr>
    
    <th>
       身份
        
    </th>
    <th>
      <select v-model="aa.MemberType_Id">
    
            <option :value="-1">--请选择--</option>
            <option  v-for="item in Xialala" :value="item.MemberType_Id">{{ item.MemberType_Name }}</option>
      </select>
        
    </th>
    </tr>
    
    
    <tr>
    
    <th>
       会员等级
        
    </th>
    <th>
      <select v-model="aa.Rank_id">
    
            <option :value="-1">--请选择--</option>
            <option  v-for="item in Xialala2" :value="item.Rank_Id">{{ item.Rank_Name }}</option>
      </select>
        
    </th>
    </tr>
    
    <th>
    
    </th>
    
    <tr>
    <th>
    
    
     <button @click="Upme">修改</button>
        
    </th>
    </tr>
    
    
    
    </table>
    
    
    </template>
    
    
    <script setup lang="ts">
    
    
  
import axios from 'axios';
    import {onMounted, ref} from 'vue';

    
    
    
    onMounted(()=>{
    
        XiaLa1();
        XiaLa2();
    })
    
    const Xialala =ref([{
    
         "MemberType_Id": -1,
        "MemberType_Name": ""
    
    }])
    
    
    const XiaLa1=()=>{
    
        axios.get('https://localhost:7035/api/Member/ShowSf').then(res=>{
    
            Xialala.value=res.data;
    
        })
    
    }
    
    const Xialala2 =ref([{
    
        "Rank_Id": 1,
        "Rank_Name": "青铜",
        "Rank_State": true,
        "Rank_MaxPoint": 0,
        "Rank_MinPoint": 100,
        "Rank_IsDel": true,
        "Rank_DeleteTime": "2024-05-05T00:00:00"
    
    }])
    
    const XiaLa2=()=>{
    
        axios.get('https://localhost:7035/api/Rank/ShowRank').then(res=>{
    
            Xialala2.value=res.data;
    
    })
    }
    
    
    
    import { useRoute,useRouter,createRouter } from 'vue-router';
    const route=useRoute();
    const cc= route.params.id

    
    const  aa = ref({
    
"Id":cc,
  "Member_Pwd":"1111",
  "Member_Name": "11111",
  "Name": "1111",
  "Member_Phone": "11111",
  "Member_Sex": true,
  "Member_IdCard": "1111",
  "Member_Birthday": "2024-12-17T11:52:05.488Z",
  "Member_Money": 1,
  "Member_State": true,
  "Member_Integration": 1,
  "MemberType_Id": 1,
  "FKT_MemberType": {
    "MemberType_Id": 0,
    "MemberType_Name": "string"
  },
  "Rank_id": 1,
  "IsDel": true

}
)



    const Upme=()=>{
            axios.put('https://localhost:7035/api/Member/UpMe',aa.value).then(res=>{

                if(res.data>0)
            {
                alert('修改成功')
            }
            else
            {
                alert('修改失败')
            }
            })
            .catch(error=>{

                console.log(error)
            })


    }
    
    
    



    
    </script>